<template>
	<view>
		<model v-if="show" v-model="obj" :confirm="confirm"></model>
	</view>
</template>
<script>
	import model from './component/addressmode'
	import {
		bootreceivingAddressselectdetail,
		bootreceivingAddressupdate
	} from '@/api/home'
	export default {
		components: {
			model
		},
		data() {
			return {
				obj: {},
				show: false
			}
		},
		onLoad(data) {
			this.bootreceivingAddressselectdetail(data.id);
		},
		methods: {
			confirm() {
				return new Promise((a) => {
					bootreceivingAddressupdate(this.obj).then(res => {
						a(res)
					})
				})
			},
			bootreceivingAddressselectdetail(id) {
				bootreceivingAddressselectdetail(id).then(res => {
					console.log(res);
					this.obj = res.data;
					this.show = true
					this.$forceUpdate()
				})
			}
		}
	}
</script>
<style>
	page {
		background-color: #E4E6E9;
	}
</style>
